<?php
/** @var string $menu */
use yii\helpers\Html;

$this->title = '菜单';
$this->params['breadcrumbs'][] = $this->title;
?>
<p class="text-right">
<?= Html::a('删除菜单', ['delete'], ['data-method'=>'post', 'data-confirm'=>'确定要删除微信菜单吗', 'class' => 'btn btn-danger']) ?>
</p>
<?php $form = \yii\bootstrap\ActiveForm::begin() ?>
<div class="form-group">
    <?= \yii\helpers\Html::textarea('menu', $menu, ['class' => 'form-control', 'rows' => 20]) ?>
    <?php if (!empty($error)): ?>
    <div class="help-block"><?= $error ?></div>
    <?php endif; ?>
</div>
<div class="form-group">
    <button class="btn btn-primary">提交</button>
</div>
<?php $form->end() ?>
<pre>
    {
  "button": [
    {
      "name": "一级餐单",
      "sub_button": [
        {
          "type": "view",
          "name": "首页",
          "url": "http://127.0.0.1:88/index.php",
          "sub_button": [

          ]
        },
        {
          "type": "click",
          "name": "测试事件",
          "key": "test",
          "sub_button": [

          ]
        }
      ]
    }
  ]
}
</pre>